package decorator_pattern;

/**
 *
 * component 定义行为
 *
 * @author lynn
 * @date 18-12-8 上午6:59
 */
public interface Component {

    /**
     * get all columns
     * @return
     */
    int getColumns();

    /**
     * get all rows
     * @return
     */
    int getRows();

    /**
     * get text for given row number
     * @param row
     * @return
     */
    String getRowText(int row);

    /**
     * show all content
     */
    default void show(){
        for (int i = 0; i < getRows(); i++) {
            System.out.println(getRowText(i));
        }
    }


}
